import http from '@/utils/axios';

// 获取列表数据
export const getArticleListApi = (params: any) => {
    return http({
        method: 'get',
        url: '/article/index',
        params,
    });
};

// 获取数据
export const getArticleInfoApi = (id: string | string[] | undefined) => {
    return http({
        method: 'GET',
        url: `/article/read/${id}`,
    });
};

// 新增数据
export const saveArticleInfoApi = (data: any) => {
    return http({
        method: 'POST',
        url: `/article/save`,
        data,
    });
};

// 更新数据
export const updateArticleInfoApi = (id: number, data: any) => {
    return http({
        method: 'PUT',
        url: `/article/update/${id}`,
        data,
    });
};

// 删除数据
export const deleteArticleInfoApi = (id: number) => {
    return http({
        method: 'DELETE',
        url: `/article/delete/${id}`,
    });
};